<template>
  <div
    :class="svgClass"
    class="icon"
    :style="{ color: props.color, fontSize: props.size }"
  ></div>
</template>

<script setup>
const props = defineProps({
  // iconClass: {
  //   type: String,
  //   required: true
  // },
  className: {
    type: String,
    default: '',
  },
  color: {
    type: String,
    default: '',
  },
  size: {
    type: String,
    default: '14px',
  },
})

const svgClass = computed(() => {
  if (props.className) {
    return `iconfont icon-${props.className}`
  }
  return 'iconfont'
})
</script>

<style scope lang="scss">
.icon {
  margin-right: 5px;
}
.sub-el-icon,
.nav-icon {
  display: inline;
  font-size: 15px;
  margin-right: 12px;
  position: relative;
}

.svg-icon {
  width: 1em;
  height: 1em;
  position: relative;
  fill: currentColor;
  vertical-align: -2px;
}
</style>
